layui.config({
    base: config.base + 'layui-admin/'
}).extend({
    index: 'lib/index'
}).use(['index'], function () {
    const $ = layui.$;
    const layer = layui.layer;
    layui.code({
        title: $('.layui-card-header').text()
        , skin: 'notepad'
        , encode: true
        , about: false
    });
    $('#login').on('click', function () {
        top.location.href = config.base + 'views/admin/login.html';
    });
    $('#error').on('click', function () {
        layer.open({
            type: 1
            , shade: false
            , title: false
            , content: $('.layui-card').html()
            , area: '100'
        });
    });
});